<template>
  <basic-container>
    <el-tabs v-model="activeName" @tab-click="handleTabClick">
      <el-tab-pane label="个人信息" name="0">
        <info />
      </el-tab-pane>
      <el-tab-pane label="修改密码" name="1">
        <password />
      </el-tab-pane>
    </el-tabs>
  </basic-container>
</template>

<script>
import func from '@/utils/func';
import { validatenull } from '@/utils/validate';
import info from './info.vue';
import password from './password.vue';

export default {
  components: { info, password },
  data() {
    return {
      activeName: '0'
    };
  },
  methods: {
    handleTabClick(tabs) {
      console.log('tabsIndex：' + tabs.index);
      if (validatenull(tabs.index)) {
        return;
      }
      this.index = func.toInt(tabs.index, 0);
      this.handleWitch();
    }
  }
};
</script>
